.NET Ramblings

My .NET notepad

ASP.NET AJAX Cascading Dropdowns – Method error 500

Another one almost driving me crazy. After about 8 hours of digging around I finally found a post that helped:

http://forums.asp.net/thread/1486888.aspx

The problem I was having, like many others, was this: I was trying to implement two cascading dropdown lists using ASP.NET AJAX (following this AJAX video – scroll down to #3 How Do I: Use the ASP.NET AJAX CascadingDropDown Control Extender?) . Everything worked except the second dropdown wouldn’t be filled with values but with error code: Method error 500.

Following the hints in the post help me nail it down. It seems the beta releases of ASP.NET AJAX have been extremely buggy. Many of the posts I found were from this beta period, which creates nightmares when you’re trying to find a solution to your problem. Great feeling when you finally nails it!

Like the video I used an XML file as data store. This is a very simple and fast implementation for small applications. If you want to use a database instead there are some sites that give some guidelines but unfortunely no one gives the whole story. This and this are the best places to start. Also this one contains lots of good info but i was having problems following along in his discussions.

December 18, 2006 Posted by | AJAX | 6 Comments

SQL Server does not allow remote connections. (provider: SQLNetwork Interfaces, error: 25 – Connection string is not valid)

“Exception Details: System.Data.SqlClient.SqlException: An error has occurred
while establishing a connection to the server. When connecting to SQL
Server 2005, this failure may be caused by the fact that under the default
settings SQL Server does not allow remote connections. (provider: SQL
Network Interfaces, error: 25 – Connection string is not valid)”

 I was going crazy over this error. I run VS2005 Standard and SQL Server 2005 (not Express).  The mdf file in my app originates from Express though. And this must be part of the problem, of course, since they are not directly compatible (SQL Server and SQL Express, that is).

The solution for me was not what I had read from other people’s experiences (even if I had found my exact problem, maybe I still wouldn’t find a solution that worked for me!).

The error code occured when I went to Server Explorer and tried to get a connection to my mdf file, a red circle and line appearing alongside the mdf file.  The mdf file was attached in Management Studio Express (I installed Management Studio Express since, for some reason, Management Studio is missing from my SQL Server installation.) Under the assumption this was interferring in some way I detached the mdf from Studio Express and tried again – same error!

This is almost as long as the problem felt for me so I will get to the solution: I deleted the connection in Server Explorer, then did Add Connection and, in the Choose Data Source dialog, instead of selecting SQL Server Database File (which would sound right) I selected <other> and then, in the Data provider field, selected .NET Framework Data Provider for SQL Server. Pressing Enter resulted in a different dialog box, than had I selected SQL Server Database File. After this it’s all downhill. I select my server, choose Windows Authentication and click on Test Connection – Bingo!

Remember this solution may or may not work for you. I should also mention that the database appears in the Data Connections list with a .dbo at the end, which was not the case before.

One other difference is that the connection string now contains
Data Source=<myservername> instead of server=(local) or server=.\MSSQLSERVER, which was there before.

December 6, 2006 Posted by | Database stuff | 19 Comments